#ifndef TASK1_MIX_H
#define TASK1_MIX_H

#include <bits/stdc++.h>
#include <opencv2/opencv.hpp>
#include <ros/ros.h>
#include <serial/serial.h>
#include <sensor_msgs/Image.h>
#include <cv_bridge/cv_bridge.h>
#include <signal.h>

#define INF 10000
#define STOP 7
#define STRIGHT 0
#define LEFT 1
#define RIGHT 2

using namespace std;
using namespace cv;

class Line {
public:
    double k;
    double x1, y1, x2, y2;
    double length;

    Line() {
        k = -INF;
    }

    Line(double _k, double _x1, double _y1, double _x2, double _y2) {
        k = _k;
        x1 = _x1;
        x2 = _x2;
        y1 = _y1;
        y2 = _y2;
        length = get_length();
    }

    bool operator<(const Line a) const {
        return this->length > a.length;
    }

    int get_dots() {
        double b = y1 - k * x1;
        return (int) ((240 - b) / k);
    };

private:
    double get_length() {
        return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    }

};

#endif //TASK1_MIX_H
